//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System.Configuration;
using System.Management.Instrumentation;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability;

namespace EntLibContrib.Resource.Configuration.Manageability
{
	/// <summary>
	/// Represents the configuration information for an instance of a concrete subclass of
	/// <see cref="EntLibContrib.Resource.Configuration.ResourceProviderDataBase"/>.
	/// </summary>
	/// <seealso cref="NamedConfigurationSetting"/>
	/// <seealso cref="ConfigurationSetting"/>
	[ManagementEntity]
	public abstract partial class ResourceProviderBaseSetting : NamedConfigurationSetting
	{
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="ResourceProviderBaseSetting"/> class.
		/// </summary>
		/// <param name="name">The name.</param>
		protected ResourceProviderBaseSetting(string name)
			: base(name)
		{
		}
		#endregion

		#region Protected Methods
		/// <summary>
		/// Applies configuration changes received by the WMI in runtime
		/// </summary>
		/// <param name="sourceElement">The configuration object on which the changes must be saved.</param>
		/// <returns>
		/// 	<see langword="true"/> if changes have been saved, <see langword="false"/> otherwise.
		/// </returns>
		/// <remarks>Must be overridden by subclasses to perform the actual save.</remarks>
		protected override bool SaveChanges(ConfigurationElement sourceElement)
		{
			return false;
		}
		#endregion
	}
}
